//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS MediaPackage service.
///
/// AWS Elemental MediaPackage
public struct MediaPackage: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the MediaPackage client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "MediaPackage",
            serviceIdentifier: "mediapackage",
            serviceProtocol: .restjson,
            apiVersion: "2017-10-12",
            endpoint: endpoint,
            errorType: MediaPackageErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Changes the Channel's properities to configure log subscription
    @Sendable
    @inlinable
    public func configureLogs(_ input: ConfigureLogsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ConfigureLogsResponse {
        try await self.client.execute(
            operation: "ConfigureLogs", 
            path: "/channels/{Id}/configure_logs", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes the Channel's properities to configure log subscription
    ///
    /// Parameters:
    ///   - egressAccessLogs: 
    ///   - id: The ID of the channel to log subscription.
    ///   - ingressAccessLogs: 
    ///   - logger: Logger use during operation
    @inlinable
    public func configureLogs(
        egressAccessLogs: EgressAccessLogs? = nil,
        id: String,
        ingressAccessLogs: IngressAccessLogs? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ConfigureLogsResponse {
        let input = ConfigureLogsRequest(
            egressAccessLogs: egressAccessLogs, 
            id: id, 
            ingressAccessLogs: ingressAccessLogs
        )
        return try await self.configureLogs(input, logger: logger)
    }

    /// Creates a new Channel.
    @Sendable
    @inlinable
    public func createChannel(_ input: CreateChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateChannelResponse {
        try await self.client.execute(
            operation: "CreateChannel", 
            path: "/channels", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new Channel.
    ///
    /// Parameters:
    ///   - description: A short text description of the Channel.
    ///   - id: The ID of the Channel. The ID must be unique within the region and it
    ///   - tags: 
    ///   - logger: Logger use during operation
    @inlinable
    public func createChannel(
        description: String? = nil,
        id: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateChannelResponse {
        let input = CreateChannelRequest(
            description: description, 
            id: id, 
            tags: tags
        )
        return try await self.createChannel(input, logger: logger)
    }

    /// Creates a new HarvestJob record.
    @Sendable
    @inlinable
    public func createHarvestJob(_ input: CreateHarvestJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateHarvestJobResponse {
        try await self.client.execute(
            operation: "CreateHarvestJob", 
            path: "/harvest_jobs", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new HarvestJob record.
    ///
    /// Parameters:
    ///   - endTime: The end of the time-window which will be harvested
    ///   - id: The ID of the HarvestJob. The ID must be unique within the region
    ///   - originEndpointId: The ID of the OriginEndpoint that the HarvestJob will harvest from.
    ///   - s3Destination: 
    ///   - startTime: The start of the time-window which will be harvested
    ///   - logger: Logger use during operation
    @inlinable
    public func createHarvestJob(
        endTime: String? = nil,
        id: String? = nil,
        originEndpointId: String? = nil,
        s3Destination: S3Destination? = nil,
        startTime: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateHarvestJobResponse {
        let input = CreateHarvestJobRequest(
            endTime: endTime, 
            id: id, 
            originEndpointId: originEndpointId, 
            s3Destination: s3Destination, 
            startTime: startTime
        )
        return try await self.createHarvestJob(input, logger: logger)
    }

    /// Creates a new OriginEndpoint record.
    @Sendable
    @inlinable
    public func createOriginEndpoint(_ input: CreateOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateOriginEndpointResponse {
        try await self.client.execute(
            operation: "CreateOriginEndpoint", 
            path: "/origin_endpoints", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new OriginEndpoint record.
    ///
    /// Parameters:
    ///   - authorization: 
    ///   - channelId: The ID of the Channel that the OriginEndpoint will be associated with.
    ///   - cmafPackage: 
    ///   - dashPackage: 
    ///   - description: A short text description of the OriginEndpoint.
    ///   - hlsPackage: 
    ///   - id: The ID of the OriginEndpoint.  The ID must be unique within the region
    ///   - manifestName: A short string that will be used as the filename of the OriginEndpoint URL (defaults to "index").
    ///   - mssPackage: 
    ///   - origination: Control whether origination of video is allowed for this OriginEndpoint. If set to ALLOW, the OriginEndpoint
    ///   - startoverWindowSeconds: Maximum duration (seconds) of content to retain for startover playback.
    ///   - tags: 
    ///   - timeDelaySeconds: Amount of delay (seconds) to enforce on the playback of live content.
    ///   - whitelist: A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint.
    ///   - logger: Logger use during operation
    @inlinable
    public func createOriginEndpoint(
        authorization: Authorization? = nil,
        channelId: String? = nil,
        cmafPackage: CmafPackageCreateOrUpdateParameters? = nil,
        dashPackage: DashPackage? = nil,
        description: String? = nil,
        hlsPackage: HlsPackage? = nil,
        id: String? = nil,
        manifestName: String? = nil,
        mssPackage: MssPackage? = nil,
        origination: Origination? = nil,
        startoverWindowSeconds: Int? = nil,
        tags: [String: String]? = nil,
        timeDelaySeconds: Int? = nil,
        whitelist: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateOriginEndpointResponse {
        let input = CreateOriginEndpointRequest(
            authorization: authorization, 
            channelId: channelId, 
            cmafPackage: cmafPackage, 
            dashPackage: dashPackage, 
            description: description, 
            hlsPackage: hlsPackage, 
            id: id, 
            manifestName: manifestName, 
            mssPackage: mssPackage, 
            origination: origination, 
            startoverWindowSeconds: startoverWindowSeconds, 
            tags: tags, 
            timeDelaySeconds: timeDelaySeconds, 
            whitelist: whitelist
        )
        return try await self.createOriginEndpoint(input, logger: logger)
    }

    /// Deletes an existing Channel.
    @Sendable
    @inlinable
    public func deleteChannel(_ input: DeleteChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteChannelResponse {
        try await self.client.execute(
            operation: "DeleteChannel", 
            path: "/channels/{Id}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an existing Channel.
    ///
    /// Parameters:
    ///   - id: The ID of the Channel to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteChannel(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteChannelResponse {
        let input = DeleteChannelRequest(
            id: id
        )
        return try await self.deleteChannel(input, logger: logger)
    }

    /// Deletes an existing OriginEndpoint.
    @Sendable
    @inlinable
    public func deleteOriginEndpoint(_ input: DeleteOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteOriginEndpointResponse {
        try await self.client.execute(
            operation: "DeleteOriginEndpoint", 
            path: "/origin_endpoints/{Id}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an existing OriginEndpoint.
    ///
    /// Parameters:
    ///   - id: The ID of the OriginEndpoint to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteOriginEndpoint(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteOriginEndpointResponse {
        let input = DeleteOriginEndpointRequest(
            id: id
        )
        return try await self.deleteOriginEndpoint(input, logger: logger)
    }

    /// Gets details about a Channel.
    @Sendable
    @inlinable
    public func describeChannel(_ input: DescribeChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeChannelResponse {
        try await self.client.execute(
            operation: "DescribeChannel", 
            path: "/channels/{Id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets details about a Channel.
    ///
    /// Parameters:
    ///   - id: The ID of a Channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeChannel(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeChannelResponse {
        let input = DescribeChannelRequest(
            id: id
        )
        return try await self.describeChannel(input, logger: logger)
    }

    /// Gets details about an existing HarvestJob.
    @Sendable
    @inlinable
    public func describeHarvestJob(_ input: DescribeHarvestJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeHarvestJobResponse {
        try await self.client.execute(
            operation: "DescribeHarvestJob", 
            path: "/harvest_jobs/{Id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets details about an existing HarvestJob.
    ///
    /// Parameters:
    ///   - id: The ID of the HarvestJob.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeHarvestJob(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeHarvestJobResponse {
        let input = DescribeHarvestJobRequest(
            id: id
        )
        return try await self.describeHarvestJob(input, logger: logger)
    }

    /// Gets details about an existing OriginEndpoint.
    @Sendable
    @inlinable
    public func describeOriginEndpoint(_ input: DescribeOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeOriginEndpointResponse {
        try await self.client.execute(
            operation: "DescribeOriginEndpoint", 
            path: "/origin_endpoints/{Id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets details about an existing OriginEndpoint.
    ///
    /// Parameters:
    ///   - id: The ID of the OriginEndpoint.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeOriginEndpoint(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeOriginEndpointResponse {
        let input = DescribeOriginEndpointRequest(
            id: id
        )
        return try await self.describeOriginEndpoint(input, logger: logger)
    }

    /// Returns a collection of Channels.
    @Sendable
    @inlinable
    public func listChannels(_ input: ListChannelsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListChannelsResponse {
        try await self.client.execute(
            operation: "ListChannels", 
            path: "/channels", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a collection of Channels.
    ///
    /// Parameters:
    ///   - maxResults: Upper bound on number of records to return.
    ///   - nextToken: A token used to resume pagination from the end of a previous request.
    ///   - logger: Logger use during operation
    @inlinable
    public func listChannels(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListChannelsResponse {
        let input = ListChannelsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listChannels(input, logger: logger)
    }

    /// Returns a collection of HarvestJob records.
    @Sendable
    @inlinable
    public func listHarvestJobs(_ input: ListHarvestJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListHarvestJobsResponse {
        try await self.client.execute(
            operation: "ListHarvestJobs", 
            path: "/harvest_jobs", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a collection of HarvestJob records.
    ///
    /// Parameters:
    ///   - includeChannelId: When specified, the request will return only HarvestJobs associated with the given Channel ID.
    ///   - includeStatus: When specified, the request will return only HarvestJobs in the given status.
    ///   - maxResults: The upper bound on the number of records to return.
    ///   - nextToken: A token used to resume pagination from the end of a previous request.
    ///   - logger: Logger use during operation
    @inlinable
    public func listHarvestJobs(
        includeChannelId: String? = nil,
        includeStatus: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListHarvestJobsResponse {
        let input = ListHarvestJobsRequest(
            includeChannelId: includeChannelId, 
            includeStatus: includeStatus, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listHarvestJobs(input, logger: logger)
    }

    /// Returns a collection of OriginEndpoint records.
    @Sendable
    @inlinable
    public func listOriginEndpoints(_ input: ListOriginEndpointsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListOriginEndpointsResponse {
        try await self.client.execute(
            operation: "ListOriginEndpoints", 
            path: "/origin_endpoints", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a collection of OriginEndpoint records.
    ///
    /// Parameters:
    ///   - channelId: When specified, the request will return only OriginEndpoints associated with the given Channel ID.
    ///   - maxResults: The upper bound on the number of records to return.
    ///   - nextToken: A token used to resume pagination from the end of a previous request.
    ///   - logger: Logger use during operation
    @inlinable
    public func listOriginEndpoints(
        channelId: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListOriginEndpointsResponse {
        let input = ListOriginEndpointsRequest(
            channelId: channelId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listOriginEndpoints(input, logger: logger)
    }

    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///
    /// Parameters:
    ///   - resourceArn: 
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Changes the Channel's first IngestEndpoint's username and password. WARNING - This API is deprecated. Please use RotateIngestEndpointCredentials instead
    @available(*, deprecated, message: "This API is deprecated. Please use RotateIngestEndpointCredentials instead")
    @Sendable
    @inlinable
    public func rotateChannelCredentials(_ input: RotateChannelCredentialsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RotateChannelCredentialsResponse {
        try await self.client.execute(
            operation: "RotateChannelCredentials", 
            path: "/channels/{Id}/credentials", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes the Channel's first IngestEndpoint's username and password. WARNING - This API is deprecated. Please use RotateIngestEndpointCredentials instead
    ///
    /// Parameters:
    ///   - id: The ID of the channel to update.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is deprecated. Please use RotateIngestEndpointCredentials instead")
    @inlinable
    public func rotateChannelCredentials(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RotateChannelCredentialsResponse {
        let input = RotateChannelCredentialsRequest(
            id: id
        )
        return try await self.rotateChannelCredentials(input, logger: logger)
    }

    /// Rotate the IngestEndpoint's username and password, as specified by the IngestEndpoint's id.
    @Sendable
    @inlinable
    public func rotateIngestEndpointCredentials(_ input: RotateIngestEndpointCredentialsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RotateIngestEndpointCredentialsResponse {
        try await self.client.execute(
            operation: "RotateIngestEndpointCredentials", 
            path: "/channels/{Id}/ingest_endpoints/{IngestEndpointId}/credentials", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Rotate the IngestEndpoint's username and password, as specified by the IngestEndpoint's id.
    ///
    /// Parameters:
    ///   - id: The ID of the channel the IngestEndpoint is on.
    ///   - ingestEndpointId: The id of the IngestEndpoint whose credentials should be rotated
    ///   - logger: Logger use during operation
    @inlinable
    public func rotateIngestEndpointCredentials(
        id: String,
        ingestEndpointId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RotateIngestEndpointCredentialsResponse {
        let input = RotateIngestEndpointCredentialsRequest(
            id: id, 
            ingestEndpointId: ingestEndpointId
        )
        return try await self.rotateIngestEndpointCredentials(input, logger: logger)
    }

    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///
    /// Parameters:
    ///   - resourceArn: 
    ///   - tags: 
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///
    /// Parameters:
    ///   - resourceArn: 
    ///   - tagKeys: The key(s) of tag to be deleted
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an existing Channel.
    @Sendable
    @inlinable
    public func updateChannel(_ input: UpdateChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateChannelResponse {
        try await self.client.execute(
            operation: "UpdateChannel", 
            path: "/channels/{Id}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing Channel.
    ///
    /// Parameters:
    ///   - description: A short text description of the Channel.
    ///   - id: The ID of the Channel to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateChannel(
        description: String? = nil,
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateChannelResponse {
        let input = UpdateChannelRequest(
            description: description, 
            id: id
        )
        return try await self.updateChannel(input, logger: logger)
    }

    /// Updates an existing OriginEndpoint.
    @Sendable
    @inlinable
    public func updateOriginEndpoint(_ input: UpdateOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateOriginEndpointResponse {
        try await self.client.execute(
            operation: "UpdateOriginEndpoint", 
            path: "/origin_endpoints/{Id}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing OriginEndpoint.
    ///
    /// Parameters:
    ///   - authorization: 
    ///   - cmafPackage: 
    ///   - dashPackage: 
    ///   - description: A short text description of the OriginEndpoint.
    ///   - hlsPackage: 
    ///   - id: The ID of the OriginEndpoint to update.
    ///   - manifestName: A short string that will be appended to the end of the Endpoint URL.
    ///   - mssPackage: 
    ///   - origination: Control whether origination of video is allowed for this OriginEndpoint. If set to ALLOW, the OriginEndpoint
    ///   - startoverWindowSeconds: Maximum duration (in seconds) of content to retain for startover playback.
    ///   - timeDelaySeconds: Amount of delay (in seconds) to enforce on the playback of live content.
    ///   - whitelist: A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateOriginEndpoint(
        authorization: Authorization? = nil,
        cmafPackage: CmafPackageCreateOrUpdateParameters? = nil,
        dashPackage: DashPackage? = nil,
        description: String? = nil,
        hlsPackage: HlsPackage? = nil,
        id: String,
        manifestName: String? = nil,
        mssPackage: MssPackage? = nil,
        origination: Origination? = nil,
        startoverWindowSeconds: Int? = nil,
        timeDelaySeconds: Int? = nil,
        whitelist: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateOriginEndpointResponse {
        let input = UpdateOriginEndpointRequest(
            authorization: authorization, 
            cmafPackage: cmafPackage, 
            dashPackage: dashPackage, 
            description: description, 
            hlsPackage: hlsPackage, 
            id: id, 
            manifestName: manifestName, 
            mssPackage: mssPackage, 
            origination: origination, 
            startoverWindowSeconds: startoverWindowSeconds, 
            timeDelaySeconds: timeDelaySeconds, 
            whitelist: whitelist
        )
        return try await self.updateOriginEndpoint(input, logger: logger)
    }
}

extension MediaPackage {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: MediaPackage, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MediaPackage {
    /// Return PaginatorSequence for operation ``listChannels(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelsPaginator(
        _ input: ListChannelsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListChannelsRequest, ListChannelsResponse> {
        return .init(
            input: input,
            command: self.listChannels,
            inputKey: \ListChannelsRequest.nextToken,
            outputKey: \ListChannelsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listChannels(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Upper bound on number of records to return.
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListChannelsRequest, ListChannelsResponse> {
        let input = ListChannelsRequest(
            maxResults: maxResults
        )
        return self.listChannelsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listHarvestJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listHarvestJobsPaginator(
        _ input: ListHarvestJobsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListHarvestJobsRequest, ListHarvestJobsResponse> {
        return .init(
            input: input,
            command: self.listHarvestJobs,
            inputKey: \ListHarvestJobsRequest.nextToken,
            outputKey: \ListHarvestJobsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listHarvestJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - includeChannelId: When specified, the request will return only HarvestJobs associated with the given Channel ID.
    ///   - includeStatus: When specified, the request will return only HarvestJobs in the given status.
    ///   - maxResults: The upper bound on the number of records to return.
    ///   - logger: Logger used for logging
    @inlinable
    public func listHarvestJobsPaginator(
        includeChannelId: String? = nil,
        includeStatus: String? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListHarvestJobsRequest, ListHarvestJobsResponse> {
        let input = ListHarvestJobsRequest(
            includeChannelId: includeChannelId, 
            includeStatus: includeStatus, 
            maxResults: maxResults
        )
        return self.listHarvestJobsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listOriginEndpoints(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listOriginEndpointsPaginator(
        _ input: ListOriginEndpointsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListOriginEndpointsRequest, ListOriginEndpointsResponse> {
        return .init(
            input: input,
            command: self.listOriginEndpoints,
            inputKey: \ListOriginEndpointsRequest.nextToken,
            outputKey: \ListOriginEndpointsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listOriginEndpoints(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelId: When specified, the request will return only OriginEndpoints associated with the given Channel ID.
    ///   - maxResults: The upper bound on the number of records to return.
    ///   - logger: Logger used for logging
    @inlinable
    public func listOriginEndpointsPaginator(
        channelId: String? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListOriginEndpointsRequest, ListOriginEndpointsResponse> {
        let input = ListOriginEndpointsRequest(
            channelId: channelId, 
            maxResults: maxResults
        )
        return self.listOriginEndpointsPaginator(input, logger: logger)
    }
}

extension MediaPackage.ListChannelsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackage.ListChannelsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MediaPackage.ListHarvestJobsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackage.ListHarvestJobsRequest {
        return .init(
            includeChannelId: self.includeChannelId,
            includeStatus: self.includeStatus,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MediaPackage.ListOriginEndpointsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackage.ListOriginEndpointsRequest {
        return .init(
            channelId: self.channelId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
